/* xbiivh.h */

 /*
 As explained in xbiimage.h, Xbox 360 discs contains a "video" partition. On original Xbox DVDs, the video partition spreads over two layers. Some replacement firmwares for the Xbox DVD drive (that lets you play game backups), let you write all the video on the first layer (layer 0), and will emulate the second layer when asked to read the video. Each XBIIntroVideoHalf structure represents a "part" of the video partition.
  
 So far there are only two known video partition that have ever been published. Since the split in the video always happens at the same place, there are only four possible CRC-32 values for any valid XBIIntroVideoHalf. 
  
 */

#ifndef XBI_IVH
#define XBI_IVH 1

#include <xbi/xbicommon.h>

typedef struct _XBIIntroVideoHalf XBIIntroVideoHalf;

// Creation - Copy - Deletion
XBIIntroVideoHalf * XBIIVHCreateFromBuffer(byte_t * buffer, size_t size, XBIError * error);
XBIIntroVideoHalf * XBIIVHCopy(XBIIntroVideoHalf * ivh);
void XBIIVHDelete(XBIIntroVideoHalf * ivh);
int  XBILoadVideoFromFile(FILE * file, XBIIntroVideoHalf * * firstIVH, XBIIntroVideoHalf * * secondIVH, XBIError * error);

// Data manipulation
uint32_t XBIIVHGetCRC32(XBIIntroVideoHalf * ivh);


// Accessors
size_t XBIIVHGetSize(XBIIntroVideoHalf * ivh);
byte_t * XBIIVHGetData(XBIIntroVideoHalf * ivh);

#endif
